home *** CD-ROM | disk | FTP | other *** search
/ Developer Helper 1: Phil & Dave's Excellent CD / Excellent CD HFS.raw / HyperCard / HyperCard 1.2.2 International / HyperCard Danish (DK-1.2.2) / Flere stakke / Salgsrapport / card_3600.txt < prev    next >
Text File  |  1988-12-19  |  3KB  |  107 lines

  1. -- card: 3600 from stack: in
  2. -- bmap block id: 4134
  3. -- flags: 0000
  4. -- background id: 2620
  5. -- name: 
  6.  
  7.  
  8. -- part 1 (button)
  9. -- low flags: 00
  10. -- high flags: A002
  11. -- rect: left=433 top=276 right=301 bottom=509
  12. -- title width / last selected line: 0
  13. -- icon id / first selected line: 0 / 0
  14. -- text alignment: 1
  15. -- font id: 0
  16. -- text size: 12
  17. -- style flags: 0
  18. -- line height: 16
  19. -- part name: Opdater
  20. ----- HyperTalk script -----
  21. on mouseUp
  22.   put the userLevel into saveLevel
  23.   if the userLevel < 3 then set userLevel to 3 -- "Painting"
  24.   if the userLevel < 3 then exit mouseUp
  25.   put frameBottom()-frameHeight()+10 into pieTop
  26.   put frameLeft()+5 into pieLeft
  27.   put frameHeight()-20 into pieDiameter
  28.  
  29.   set cursor to 4 -- watchCursor
  30.   Set lockScreen to true
  31.   clearScreen
  32.   reset paint
  33.   choose oval tool
  34.   set lineSize to 2
  35.   set dragSpeed to 0
  36.   drag from pieLeft,pieTop to pieLeft+pieDiameter, pieTop+pieDiameter
  37.   set centered to false
  38.  
  39.   put the number of lines in field "Data" into dataCount
  40.   put zero into total
  41.   repeat with i = 1 to dataCount
  42.     add line i of field "Data" to total
  43.   end repeat
  44.   put "Total er" && total into background field "Total"
  45.  
  46.   put pieDiameter div 2 into pieRadius
  47.   put pieLeft+pieRadius into pieCenterX
  48.   put pieTop+pieRadius into pieCenterY
  49.  
  50.   choose line tool
  51.   put zero into angle
  52.   put zero into change
  53.   repeat with i = 1 to dataCount+1
  54.     put pieCenterX + round(pieRadius * sin(angle)) into x
  55.     put pieCenterY - round(pieRadius * cos(angle)) into y
  56.     choose line tool
  57.     drag from pieCenterX,pieCenterY to x,y
  58.     if change > .02 then
  59.       set pattern to getPattern(i)
  60.       choose bucket tool
  61.       click at halfX, halfY
  62.     end if
  63.  
  64.     get line i of field "data"
  65.     put pi * it / total into change
  66.     add change to angle
  67.     put pieCenterX + round((pieRadius-3) * sin(angle)) into halfX
  68.     put pieCenterY - round((pieRadius-3) * cos(angle)) into halfY
  69.     add change to angle
  70.  
  71.   end repeat
  72.   reset paint
  73.   choose browse tool
  74.   set userLevel to saveLevel
  75.   Set lockScreen to false
  76. end mouseUp
  77.  
  78. function getPattern selector
  79. return item (selector mod 12)+1 of "2,13,11,3,14,6,21,17,31,18,4,32"
  80. end getPattern
  81.  
  82.  
  83. -- part contents for background part 5
  84. ----- text -----
  85. 50
  86. 60
  87. 13
  88. 26
  89. 45
  90. 78
  91.  
  92.  
  93. -- part contents for background part 9
  94. ----- text -----
  95. Total er 272
  96.  
  97. -- part contents for background part 11
  98. ----- text -----
  99. Indt√¶gter pr. varegruppe
  100.  
  101. -- part contents for background part 13
  102. ----- text -----
  103. 3 af 3
  104.  
  105. -- part contents for background part 12
  106. ----- text -----
  107. 1988 Rapport